import shutil
#切分验证集

f_txt = open('/media/lizhiheng/507551c1-feff-497f-a384-5b4682f1f1f4/PASCAL VOC/VOC2012/ImageSets/Segmentation/val.txt', 'r')
f_images = '/home/lizhiheng/model/ViLSeg/ILSVRC/DATA/CLS-LOC/val/images'
f_annotation = '/media/lizhiheng/507551c1-feff-497f-a384-5b4682f1f1f4/ViLSeg-torch/ViLSeg/ILSVRC/DATA/CLS-LOC/val/annotations'

context = list(f_txt)
for imagename in context:
    imagename = imagename[0:11]
    annotation_path = '/media/lizhiheng/507551c1-feff-497f-a384-5b4682f1f1f4/PASCAL VOC/VOC2012/SegmentationClass/' + imagename + '.png'
    shutil.copy(annotation_path, f_annotation)